
import mx.collections.ArrayCollection;
import mx.events.DragEvent;
override protected function dragDropHandler(evt:DragEvent):void
{
	try
	{
		if(evt.target == evt.dragInitiator)
		{
			super.dragDropHandler(evt);
		}
		else
		{
			
			if(justIn((evt.dragInitiator as DataGrid).selectedItem))
			{
				
			}
			else
			{
				super.dragDropHandler(evt);
			}
		}
	}
	catch(error:Error)
	{
		trace(error.getStackTrace());
	}
	
	test();
}

private function test():void
{
	var d:ArrayCollection	=	this.dataProvider as ArrayCollection;
	for(var i:int=0; i<d.length; i++)
	{
		trace(d[i].name+"   frim name   "+d[i].firmID+"  firmid");
	}
	
}

private function justIn(object:Object):Boolean
{
	var d:ArrayCollection	=	this.dataProvider as ArrayCollection;
	for(var i:int=0; i<d.length; i++)
	{
		if(d[i].firmID == object.firmID)
		{
			return true;
		}
	}
	return false;
}

private function showID(object:Object,column:DataGridColumn):String
{
	var index:int	=	this.dataProvider.getItemIndex(object)+1;
	return ""+index;
}